<div id="pagenumbers" style="text-align: center; margin-top: 1em;">
	<%
		if(resultListSize > 10){
			int numberofResultpages = (int) Math.ceil(resultListSize / 10.0);
			if(currentPage > 1){
				int showPrev = currentPage-1;
				%>
				<span><strong><a href="<%= pageIdURL + "?pageID=" + showPrev %>">previous</a></strong></span>&nbsp;&nbsp;
				<%
			}
			out.print("<span>");
			if(numberofResultpages <= 10){
				for(int i = 1; i <= numberofResultpages; i++){
					%>
					<a href="<%= pageIdURL + "?pageID=" + i %>" <%if(i == currentPage){out.print("style=\"font-weight:bold;color:red;\"");}%>><%=i %></a>
					<%
				}
			}else {
				if(numberofResultpages - currentPage >= 10){
					int start = 0;
					int end = 0;
					
					if(currentPage < 7){
						start = 1;
						end = 7;
					}else {
						
						%>
						<a href="<%= pageIdURL + "?pageID=" + 1 %>"><%=1 %></a>
						<%
						out.print("&nbsp;...&nbsp;");
						start = currentPage - 3;
						end = currentPage + 3;
					}
					
					for(int i = start; i <= end; i++){
						%>
						<a href="<%= pageIdURL +  "?pageID=" + i %>" <%if(i == currentPage){out.print("style=\"font-weight:bold;color:red;\"");}%>><%=i %></a>
						<%
					}
					out.print("&nbsp;...&nbsp;");
					%>
					<a href="<%= pageIdURL +  "?pageID=" + numberofResultpages %>"><%=numberofResultpages %></a>
					<%
				}
				else {
					%>
					<a href="<%= pageIdURL +  "?pageID=" + 1 %>"><%=1 %></a>
					<%
					out.print("&nbsp;...&nbsp;");
					//out.print("...&nbsp;");
					for(int i = numberofResultpages - 10; i <= numberofResultpages; i++){
						%>
						<a href="<%= pageIdURL +  "?pageID=" + i %>" <%if(i == currentPage){out.print("style=\"font-weight:bold;color:red;\"");}%>><%=i %></a>
						<%
					}
				}
			}
			out.print("</span>");
			if(currentPage < numberofResultpages){
				int showNext = currentPage+1;
				%>
				<span><strong><a href="<%= pageIdURL  + "?pageID=" + showNext %>">next</a></strong></span>&nbsp;&nbsp;
				<%
			}
		}
	%>
</div>	